<%-- 
    Document   : homeWarehousing
    Created on : Sep 13, 2013, 9:32:22 AM
    Author     : Trang
--%>
<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>
<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Staff Management</title>
        <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_warehousing.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>
    </head>
    <script>
        function myFunction()
        {
            var x;
            var r = alert("You cannot delete this item.");

            //document.getElementById("demo").innerHTML=x;
        }
    </script>
    <body style="background-color: lightsteelblue;">
        <% int i = 0;%>
        <div class="headerbg">
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>
        </div>
        <div class="contentbg">
            <div class="content">
                <div style="width: 1024px; color: white; background-color: #610B0B; float:left;margin:auto;">
                    <h3 style="margin-left: 10px;">Staff Information</h3>
                </div>
                <div id="errorMessage" style="border-bottom: 1px #610B0B dashed; ">   
                    
                     <div id="sl12">
                        <s:url namespace="/Administration/Staff"  action="add-staff" var="addStaffUrl"></s:url>
                        <s:a href="%{addStaffUrl}"  title="Add Staff">
                            <img src="<%= request.getContextPath()%>/css/create.png" alt="Add Staff" title="Add Staff" style="height: 40px; width: 40px;"/>
                        </s:a>

                    </div>
                    
                </div>  
                <div class="content2">
                    <div class="datagrid2">                  
                        <display:table id="data" export = "true" name="staffs" pagesize="8" requestURI="staff-management">    
                            <%i++;%>
                            <display:column title="No" media="html" group="1" >
                                <p><%out.print(i);%></p>
                            </display:column>          
                            <display:column property="loginName" title="Login Name" sortable="true"/>         
                            <display:column property="firstname" title="First Name" sortable="true" />
                            <display:column property="lastname" title="Last Name" sortable="true" />
                            <display:column property="role" title="Role" sortable="true"/>
                            <display:column property="address" title="Address" maxWords="5" sortable="true"/>
                            <display:column property="dob" title="DOB"  sortable="true" />
                            <display:column property="email" title="Email" sortable="true" />

                            <display:column media="html">
                                <img onclick="myFunction();"  src="<%= request.getContextPath()%>/image/Delete.gif" style="" alt="delete staff" width="20" height="auto" title="Delete Staff"/>  
                            </display:column>
                        </display:table>
                    </div> 
                </div>
            </div>
            <footer>
                <div id="footer">
                    <%@include file="/include/iFooter.jsp" %>
                </div>    
            </footer>
    </body>
</html>
<%
    }
%>